<!--
 * @Description: 
 * @Version: 1.0.0
 * @Author: gyh
 * @Date: 2021-08-17 22:33:44
 * @LastEditors: gyh
 * @LastEditTime: 2021-08-17 23:01:06
-->
<template>
  <h1>Home Page</h1>
  <h2>{{ count }}</h2>
  <el-button type="primary" @click="handleClick">click</el-button>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import { useStore } from 'vuex'

export default defineComponent({
  setup() {
    const store = useStore()
    const count = computed(() => store.state.home.count)
    const handleClick = () => {
      store.commit('home/add')
    }
    return {
      handleClick,
      count,
    }
  },
})
</script>
